/**
 * 备份管理相关接口
 */
import request from '@/utils/request'

// 获取备份列表
export function getBackupList(params) {
  return request({
    url: '/backup/list',
    method: 'get',
    params
  })
}

// 创建备份
export function createBackup() {
  return request({
    url: '/backup/create',
    method: 'post'
  })
}

// 恢复备份
export function restoreBackup(id) {
  return request({
    url: `/backup/${id}/restore`,
    method: 'post'
  })
}

// 删除备份
export function deleteBackup(id) {
  return request({
    url: `/backup/${id}`,
    method: 'delete'
  })
}

// 下载备份
export function downloadBackup(id) {
  return request({
    url: `/backup/${id}/download`,
    method: 'get',
    responseType: 'blob'
  })
}

// 获取备份设置
export function getBackupSettings() {
  return request({
    url: '/backup/settings',
    method: 'get'
  })
}

// 更新备份设置
export function updateBackupSettings(data) {
  return request({
    url: '/backup/settings',
    method: 'put',
    data
  })
} 